Maximum data size and string casting in python3#14
Open
lucabodd wants to merge 3 commits intoeblot:python3from
Open
Maximum data size and string casting in python3#14lucabodd wants to merge 3 commits intoeblot:python3from
lucabodd wants to merge 3 commits intoeblot:python3from
Conversation
Casting bytes to string, in python3 casting bytes to string is not implicit
tftpd before doesn't allow to send data up to 16,7MB (512*32767) because "int" was overflowing and expecting an ack backet with negative ACK: fixed initializing self.blockNumber = np.int16(0x0000) and sum block with block = self.blockNumber = np.int16(self.blockNumber + 1)
Owner
|
Hi Luca, I did not merge the PR per se but i think I fixed both issues based on your patch files - I do not have a way to test PXE for now, so if you can git it a try. Thanks. |
Author
|
I see..
About the bug on pxed, I don’t know, I was getting a TypeError concatenating string to bytes…
About the tftp I also tried to set hH to buffer fmt but was not working … if you tested and it’s working it’s surely a better fix rather than import all numpy
Anyway, glad to have helped you… Thanks a lot
Luca
… On 19 Sep 2019, at 10:17, Emmanuel Blot ***@***.***> wrote:
Hi Luca,
I did not merge the PR per se but i think I fixed both issues based on your patch files - I do not have a way to test PXE for now, so if you can git it a try.
Thanks.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#14?email_source=notifications&email_token=AFOGSIAB4LYL52HRBFNWW43QKMYSVA5CNFSM4IX5I462YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7CUJPQ#issuecomment-533021886>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AFOGSIC647MHBXMJU46ELPTQKMYSVANCNFSM4IX5I46Q>.
|
Owner
|
On 19 Sep 2019, at 11:41, Luca Bodini wrote:
I see..
About the bug on pxed, I don’t know, I was getting a TypeError
concatenating string to bytes…
I think it was because of the first empty string (‘’ instead of
b’’)
About the tftp I also tried to set hH to buffer fmt but was not
working … if you tested and it’s working it’s surely a better
fix rather than import all numpy
It is two fold:
- only the last 16-bit should be preserved, and
- struct is likely to reject a negative integer value if ‘H’ is
specified. Conversely, only using 0xFFFF would generate integer > 32767,
and struct would also reject those with ‘h’ encoding. As 0xFFFF
should not generate a negative number, it should be ok.
Let me know if you can test all this.
Thanks
Emmanuel.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As you can see on commits, I added in PXE casting from bytes to string that otherwise generates a TypeError on concatenating bytes (in python3 casting to string is not implicit).
Fixing TFTP "wrap-around" on short ints, now TFTP can send files up to 16M (till 32 MB as defined by TFTP) but package now requires numpy